/**
@file
@brief Algorithms to caculate rotating speed of motor.
@details All the algorithms here use the unit of speed in revs/s (revolutions per second), of position in loops.
*/

#ifndef POSSPDFEEDBACK_H__
#define POSSPDFEEDBACK_H__

#include "board.h"
#include "Encoder.h"


typedef volatile struct {
    int32_t s32d3EncLoopsOld;    // last number of loops
//    int32_t s16d3EncPulsOld;     // last number of pulses
    int32_t s32d3EncLoopsCur;    // current number of loops
//    int32_t s16d3EncPulsCur;     // current number of pulses
} PosSpd_TypeDef;


void Spd_ReadPosSpdD3(PosSpd_TypeDef* pstPosSped, Enc_TypeDef* pstEnc, int32_t *s32d3Spd, int32_t dt_milli_sec);
//void Spd_ReadPosSpdCnt(Enc_TypeDef* pstEnc, int32_t *s32d3Pos, int32_t *s32d3Spd, int32_t dt_milli_sec);

#endif  // POSSPDFEEDBACK_H__
